/**
  ******************************************************************************
  * @author     Chris
  * @since      2023/10/17 10:36
  *
  * @file       hd_24cxx.h
  * @brief      Head file of Xxx Hardware Driver.
  *
  * @note       This file contains the hardware driver's function declaration 
  *             for the Xxx.
  *
  * @warning    None.
  ******************************************************************************
  * Change Logs:
  *   Date           Author       Notes
  *   2023/10/17     Chris        the first version
  *
  ******************************************************************************
  */

#ifndef JXTECH_HD_24CXX_H
#define JXTECH_HD_24CXX_H

#include "stm32g4xx.h"

/**
 * 24Cxx 系列芯片，1K/2K 的 8 字节为 1 页，其它则 16K 为一页
 */
typedef enum {
    HD_24CXX_PAGE_8 = 0x08,
    HD_24CXX_PAGE_16 = 0x10
} HD_24CXX_PageDef;
#define HD_24CXX_PAGE HD_24CXX_PAGE_16

/**
 * 24CXX 器件地址
 */
#define HD_24CXX_ADDRESS    0xA0

void HD_24Cxx_Init(void);

void HD_24Cxx_Read(uint8_t regAddress, uint8_t *dat, uint8_t len);

void HD_24Cxx_Write(uint8_t regAddress, uint8_t *dat, uint8_t len);

#endif // JXTECH_HD_24CXX_H
